package thread;

public class Test2 {
	public static ThreadLocal<String> local = new ThreadLocal<String>();
	
	public static void main(String[] args) throws InterruptedException {
		local.set("john");
		System.out.println(local.get());
		new Thread(){
			public void run(){
				local.set("tom");
				System.out.println(local.get());
				
				System.out.println(local.get());
			}
			
		}.start();
		
		Thread.sleep(1000);
		System.out.println(local.get());
	}

}
